<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>SaySaying校园表白墙</title>
	<meta name="keywords" content="SaySaying,SaySaying校园表白墙,校园表白墙,校园,表白墙"/>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/bootstrap.css">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/animate.min.css">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/style.css">
	<script type="text/javascript" src="__PUBLIC__/js/jquery-2.2.3.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/bootstrap3.0.3.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/wow.min.js"></script>

</head>
<body>


<nav class="navbar navbar-default">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#collapse" aria-expanded="false">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <h3 class="text-center">
      	<a href={:U("Home/Index/index")}>
      		{$is.sname}校园表白墙
       	</a>
      </h3>
    </div>
    <div class="collapse navbar-collapse" id="collapse">
      <ul class="nav navbar-nav">
          <?php
          if($session_id < 1) {
              ?>
              <li>
                  <a href={:U("Home/Login/index")}>请登录</a>
              </li>
              <?php
          }else {
              ?>
              <li>
                  <a href={:U("Home/User/index")}>欢迎{$is.ssid}</a>
              </li>
              <li>
                  <a href={:U('Home/User/index')}>个人中心</a>
              </li>
              <?php
          }
          ?>

            <li>

                <a href={:U('Home/Index/add')}?do=chk>发布表白</a>
            </li>
          <?php
          if($session_id < 1) {
              ?>
              <li>
                  <a href={:U('Home/Register/index')}>注册</a>
              </li>
              <?php
          }else {}
              ?>
          <li>
              <a target="_blank" href="http://koudaigou.net/f/58ff5b7de7aea93af3d06532">意见反馈</a>
          </li>
        <li>
          <a href="{:U('/Home/User/Logout')}">退出登录</a>
        </li>
      </ul>
  </div>
</nav>
<!-- 导航结束 -->
<!-- 内容开始 -->
<!-- xs表示手机，sm表示平板，md表示电脑，lg...大屏幕-->
<!-- 这里加载数据得准备4列 ,加载数据动态加载个到col中-->
<div class="container-fluid" id="main">
	<div class="col-xs-12 col-sm-6 col-md-3">
        <foreach name="data['contents']" item="val">
		<div class="list wow fadeIn" data-wow-delay="0.3s">
			<div class="list-header">
				<times>{$val.intime|date="Y-m-d H:i",###}</times>
				<h4>TO : {$val.content_to}</h4>
			</div>
			<div class="list-content">
				{$val.content}
			</div>
			<div class="list-footer">
				<h4>FROM : {$val.ssid}</h4>
				<p>
					<!-- <a href="javascript:;" class="laud" name="{$val.id}" type="1"> 赞(<span>{$val.laud}</span>)</a>
          <a href="javascript:;" class="get_comment">查看评论</a>          
                    <input type="hidden" class="hidden"  name="{$val.id}">
<<<<<<< HEAD
					<a href="#"> </a> -->
          <a  class="" href="{:U('/Home/Index/singleSay',array('pid'=>$val['id']))}">查看详情</a>   
=======
					<a href="#"> </a>
         <!-- JiaThis Button BEGIN -->
<div class="jiathis_style_24x24">
  <a class="jiathis_button_cqq"></a>
  <a class="jiathis_button_weixin"></a>
  <a class="jiathis_button_qzone"></a>
  <a class="jiathis_button_tsina"></a>
  <a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
</div>
<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END -->
>>>>>>> temp
				</p>
			</div>
      <div class="see_comment">
      </div>
<!--            --><?php
//            //实例化数据库
//            $page = D("page");
//            $ss = D("user");
//            $comment = D("comment");
//
//            $comment_datas = $comment->where("pid={val.id}")->find();
//            ?>
			<!-- <div class="comment">
                <?php foreach ($comment_datas as $comment_datas): ?>
				<p><span><?php echo $comment_datas['ssid']; ?></span>：<?php echo $comment_datas['comm']; ?></p>
				<?php endforeach; ?>
			</div> -->
		</div>
        </foreach>
	</div>





</div>

<script type="text/javascript">
  $(function(){
    //评论
    $('.get_comment').click(function(){
      if($(this).text() == '查看评论'){
        $(this).html('收起评论');
        var div = $(this).parent().parent().parent();
        var id = div.find('.hidden').attr('name');
        $.get('__CONTROLLER__/get_comment?id='+id,function(re){
          var p = '';
            for(var i=0;i<re.length;i++){
              p = p + '<p><span style="color:#337ab7">'+re[i].ssid+':</span>'+re[i].comm+'</p>';
            }
            div.find('.write_comment').after(p);
        },'json')
        var str = 
                      '<div class="input-group write_comment">'+
                          '<input type="text" class="form-control input_comment" name="comment" placeholder="评论">'+
                          '<span class="input-group-btn">'+
                          '<button class="btn btn-default commit_comment">发送</button>'+
                          '</span>'+
                      '</div>';                    
        div.find('.see_comment').html(str);
      }else if($(this).text() == '收起评论'){
        $(this).html('查看评论');
        var div = $(this).parent().parent().parent();
        div.find('.see_comment').html('');
      }                                         
    })
    $(document).on('click','.commit_comment',function(){
     var div = $(this).parent().parent().parent().parent();
     var id = div.find('.hidden').attr('name');
     var content = div.find('.input_comment').val();
     if(content == ''){
      alert('请输入留言');
      return false;
     }
      $.post('__CONTROLLER__/get_comment',{id:id,content:content},function(re){
        if(re.error == 1 ){
          alert('请先登录');
          location.href="__MODULE__/Login/index";
        }else{
          var p = '<p><span style="color:#337ab7">'+re.ssid+':</span>'+re.comm+'</p>';
          div.find('.write_comment').after(p);
        }
      },'json')
    })
    //赞
    $('.laud').click(function(){
      var id = $(this).attr('name');
      var laud = $(this).find('span').text();
      if($(this).attr('type') == 1){
        laud = parseInt(laud) + 1;
        $(this).find('span').html(laud);
        $(this).css('color','red');
        $(this).attr('type',2);
        $.post('__CONTROLLER__/laud',{id:id,type:1},function(){
        })  
      }else{
        laud = parseInt(laud) - 1;
        $(this).find('span').html(laud);
        $(this).css('color','#337ab7');
        $(this).attr('type',1);
        $.post('__CONTROLLER__/laud',{id:id,type:2},function(){
        })
      }
    })
  })
</script>
<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1261708147'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s11.cnzz.com/z_stat.php%3Fid%3D1261708147%26show%3Dpic' type='text/javascript'%3E%3C/script%3E"));</script>
</body>

   




</html>
<script>
if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){
	new WOW().init();
};
</script>

